import {getSeriesDetail} from '../../../api/recommedCourse';
Component({
  data:{
    title:"",
    serialId:0,
    SeriesCourseDetail:{

    }
  },
  methods:{
    onLoad(data:any){

      const {courseserialid,courseserialname} = data
     this.setData({
      title:courseserialname,
      serialId:courseserialid
     })
     this.getSeriesDetail()
    },
   async getSeriesDetail(){
   const {code,data:res} =  await getSeriesDetail({serialId:this.data.serialId});
   if(code === 200){
     console.log(res);
     this.setData({
      SeriesCourseDetail:res
     })
   }
    },
    courseOrder(e:any){
      const {courseserialid} = e.currentTarget.dataset
      wx.navigateTo({
        url:`/myCourse_package/pages/courseOrder/courseOrder?serialId=${courseserialid}`
      })
    }
  }
})